import request from '../utils/request';

/**
 * 查询会员列表
 * @param query
 * @returns {AxiosPromise}
 */
export const selectPage = query => {
    return request({
        url: 'rest/device/selectPage',
        method: 'POST',
        data: query
    });
};


/**
 * 新增会员
 * @param query
 * @returns {AxiosPromise}
 */
export const addDevice = query => {
    let url = 'rest/device/insert';
    return request({
        url: url,
        method: 'POST',
        data: query
    });
};


/**
 * 编辑会员
 * @param query
 * @returns {AxiosPromise}
 */
export const updateDevice = query => {
    return request({
        url: 'rest/device/updateDevice',
        method: 'POST',
        data: query
    });
};

/**
 * 删除会员
 * @param query
 * @returns {AxiosPromise}
 */
export const delDevice = query => {
    return request({
        url: 'rest/device/delete',
        method: 'POST',
        data: query
    });
};

/**
 * 查询会员
 * @param query
 * @returns {AxiosPromise}
 */
export const getDeviceByID = query => {
    return request({
        url: 'rest/device/getById/' + query,
        method: 'POST',
    });
};